package com.demo.security.access.model;

/**
 * 安全资源模型 <br>
 * 对站点资源(URL)安全提供模型基础
 * 
 * @author ryuu.kk
 * 
 */
public class SecurityResource implements java.io.Serializable {

	/**
	 * 序列化ID
	 */
	private static final long serialVersionUID = 1993000597742272983L;
	
	/**类型：URL资源**/
	public static final String TYPE_URL = "0";
	
	/**类型：METHOD资源**/
	public static final String TYPE_METHOD = "1";
	
	/**
	 * 主键Key
	 */
	private Long id;
	
	/**
	 * 名称
	 */
	private String name;
	
	/**
	 * 受保护资源(URL or Method)
	 */
	private String resource;
	
	/**
	 * 安全验证表达式
	 * 如果是基于角色的表达式,
	 * expression字段将为角色字符串(ROLE_ADMIN),
	 * 如果多个,则用","进行分割。
	 */
	private String expression;
	
	/**
	 * 解析器
	 * 表达式的分析器类型
	 */
	private String resolver;
	
	/**
	 * 是否允许匿名访问
	 */
	private Boolean isAnonymous;
	
	/**
	 * 是否可用
	 */
	private Boolean enabled;

	/**
	 * 安全资源类型
	 */
	private String type;
	
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getResource() {
		return resource;
	}

	public void setResource(String resource) {
		this.resource = resource;
	}

	public String getExpression() {
		return expression;
	}

	public String getResolver() {
		return resolver;
	}

	public void setResolver(String resolver) {
		this.resolver = resolver;
	}

	public Boolean getIsAnonymous() {
		return isAnonymous;
	}

	public void setIsAnonymous(Boolean isAnonymous) {
		this.isAnonymous = isAnonymous;
	}

	public Boolean getEnabled() {
		return enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	public void setExpression(String expression) {
		this.expression = expression;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}
